<div class="pages-title section-padding">
    <div class="container">
        <div class="row">
            <div class="col-xs-12">
                <div class="pages-title-text text-center">
                    <h2>Register</h2>
                    <ul class="text-left">
                        <li><a href="../../dist/views/home/index.html">Home </a></li>
                        <li><span> // </span>Register</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- pages-title-end -->
<!-- login content section start -->
<section class="pages login-page section-padding">
    <div class="container">
        <div class="row">
            <div class="col-sm-6">
                <div class="main-input padding60">
                    <div class="log-title">
                        <h3><strong>registered customers</strong></h3>
                    </div>
                    <div class="login-text">
                        <div class="custom-input">
                            <p>If you have an account with us, Please log in!</p>
                            <form id="form_login" action="" method="post">
                                <input type="text" name="username" placeholder="username" />
                                <input type="password" name="password" placeholder="Password" />
                                <a class="forget" href="#">Forget your password?</a>
                                <div class="submit-text">
                                    <button type="submit">登录</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="main-input padding60 new-customer">
                    <div class="log-title">
                        <h3><strong>new customers</strong></h3>
                    </div>
                    <div class="custom-input">
                        <form action="/account/register" method="post">
                            <input type="text" name="username" placeholder="Name here.." value="{{user.username}}"/>
                            <input type="text" name="email" placeholder="Email Address.." value="{{user.email}}"/>
                            <input type="text" name="number" placeholder="Phone Number.." />
                            <input type="password" name="Password" placeholder="Password" />
                            <input type="password" name="confirm" placeholder="Confirm Password" />
                            <label class="first-child">
                                <input type="checkbox" name="rememberme" value="forever"> 同意
                            </label>

                            <div class="form-group"></div>
                                <p class="help-desk">{{message}}</p>
                            <div class="submit-text coupon">
                                <button type="submit">注册</button>

                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>


{{#block 'scripts'}}
    <script>
        $(function () {
            $('#form_login').on('submit',function () {
                //获取两个文本框的值
                var $username=$('#form_login input[name="username"]');
                var $password=$('#form_login input[name="password"]');

                var username=$username.val();
                var password=$password.val();

                //发送ajax请求
                //XMLHttpRequest
                $.post('/account/login',
                        {username:username,password:password},
                        function (data) {
                            alert(data);
                        });

                //组织默认事件
                return false;
            })
        })
        
    </script>
{{/block}}